import { View, Text } from '@tarojs/components';
import { useLoad, useDidShow } from '@tarojs/taro';
import './index.scss';
import { useStore } from '../../store/useStore';
import { AtButton } from 'taro-ui';

export default function Index() {
  const { count, increment } = useStore();

  useLoad(() => {
    console.log('Page loaded. 122');
  });

  useDidShow(() => {
    console.log('Page showed. 11');
  });

  return (
    <View className="index">
      <Text>Hello world!</Text>
      <View className="count">Count: {count}</View>
      <AtButton type="primary" onClick={increment}>
        加
      </AtButton>
    </View>
  );
}
